package com.hu.reggie.controller;

import com.hu.reggie.common.R;
import com.hu.reggie.pojo.Orders;
import com.hu.reggie.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Service
@RequestMapping("/order")
public class OrdersController  {

    @Autowired
    private OrdersService ordersService;

    // 用户下单
    @PostMapping("/submit")
    public R<String> submit(@RequestBody Orders orders){

        ordersService.submit(orders);

        return R.success("订单已提交");
    }
}
